Identifying and analyzing multiple level class relationships in an object oriented system by parsing source code without compilation

ABSTRACT

A system and method for identifying class relationships in an object oriented system. An object oriented program in an object oriented source code language is parsed for the immediate class relationship data. The immediate class relationship data is stored in a relation data library. In response to a user query, a derive engine is employed to derive multiple level class relationship data from the immediate class relationship data. The multiple class relationship data is presented on a system display to the user. As the number of immediate class relationships captured by the parser will be overwhelmingly huge in the case of a huge object oriented system, the derivation step is preferably divided into two. In anticipation of the user query, the immediate relationship data for each class of object is preprocessed and stored in a facts library according to class and type of relationship. This facts library is traversed by the derive engine in response to the user query to derive the multiple level class relationship data.

BACKGROUND OF THE INVENTION

This invention relates generally to object oriented programming. Moreparticularly, it relates to a class relationship tool for identifyingand analyzing the class relationships for an object oriented systemwithout requiring compilation.

Object oriented programming is one of the most important newtechnologies in software development. Object oriented programming offerssignificant capabilities in increasing programmer productivity andsoftware code reuse. In object oriented programming, data and methodsthat operate on the data are combined into packages called "objects". Bystandardizing the messaging paths with which the objects communicate andlimiting the interaction between objects to the standard paths, objectoriented programming removes much of the complexity of traditionalprocedurally oriented programming.

A brief overview of some of the more important aspects of objectoriented programming are provided below. More detailed discussions areavailable in many publicly available documents including Object OrientedDesign With Applications by Grady Booch, Benjamin/Cummins PublishingCompany, 1991 and Object Oriented Requirements Analysis and LogicalDesign by Donald G. Firesmith, John Wiley and Sons, Inc., 1993. Anobject includes a set of data which may be called "attributes" and a setof operations called "methods" which operate on the data. An object'sdata may generally change only through the operation of the object'smethods. The combination of data and methods and objects is called"encapsulation". Through encapsulation, data within an object can onlybe changed by the methods associated with that object. The theory isthat when the behavior of an object is confined to defined locations andinterfaces, code modifications in the objects will have minimal impacton the other objects and elements in the system. Encapsulation alsooffers code which is more modular and maintainable than code writtenusing more procedural techniques.

Another basic concept of object oriented programming is the "class". Aclass includes a set of data attributes, plus a set of allowable methodson the data attributes. Each object is usually an instance of someclass. A class may be derived from another class in a process called"subclassing" or "inheritance". The subclass inherits the dataattributes and methods of the parent or base class. A subclass typicallyadds code which overrides the data and/or methods of the base class oradds new data attributes and methods. As new subclasses are created,greater levels of specialization are provided. Through inheritance,developers may minimize the amount of new code needed to write anapplication program. As a significant portion of the functions neededfor a particular task is provided in the base classes or some otherclass in the inheritance hierarchy, the programmer has a head start inprogram design and creation.

However, as classes begin to proliferate in a huge object orientedsystem, it is not unusual to have thousands of classes. It is oftendifficult to understand the relationship between two objects in theclass hierarchy. Compounding the problem are the encapsulation andinformation hiding which are typical characteristics of object orientedsystems. Identifying the relationships between classes becomes crucialfor understanding, using and testing the system. Class relationships areoften transitive. In a system with over a thousand classes, it is notdifficult to find class relationships with long paths. This alsoincreases the difficulty and complexity in identifying classrelationships. Most existing tools for identifying class relationshipsin an object oriented system are of a browser type. There is afundamental problem using browsers for huge object oriented systems:immediate class relationships are captured by the compiler. Thus,compilation becomes a prerequisite condition which is hard to satisfysince most object oriented programming language compilers are still notfully compatible to each other.

Therefore, there exists a need for a technique for identifying andanalyzing class relationships in object oriented systems withoutrequiring compilation.

SUMMARY OF THE INVENTION

Therefore, it is an object of the invention to identify and analyzeclass relationships in a huge object oriented system withoutcompilation.

It is another object of the invention to efficiently handle a huge setof class relationships.

It is another object of the invention to allow sufficient flexibility indesign for incremental development to account for changes in the objectoriented system as it matures.

It is another object of the invention to allow porting of objectoriented software between platforms.

These and other objects are accomplished by a system and method foridentifying class relationships in an object oriented system. First, anobject oriented program in an object oriented source code language isparsed for the immediate class relationship data. The immediate classrelationship data is stored in a relation data library. In response to auser query, a derive engine is employed to derive multiple level classrelationship data from the immediate class relationship data. Themultiple class relationship data is presented on a system display to theuser.

As the number of immediate class relationships captured by the parserwill be overwhelmingly huge in the case of a huge object orientedsystem, the derivation step is preferably divided into two. Inanticipation of the user query, the immediate relationship data for eachclass of object is preprocessed and stored in a facts library accordingto class and type of relationship. This facts library is traversed bythe derive engine in response to the user query to derive the multiplelevel class relationship data.

BRIEF DESCRIPTION OF THE DRAWINGS

These objects, features and advantages will be more readily understoodwith reference to the attached figures and following description.

FIG. 1 depicts a computer system configured according to the teachingsof the present invention.

FIG. 2 illustrates the overall process for parsing the object orientedprogram to identify the class relationships therein and storing thoserelationships in a relation data library.

FIG. 3 shows the overall process of generating the facts data libraryfrom the relation data library.

FIG. 4A depicts the process for answering a user query for a classrelationship.

FIG. 4B shows one possible output format for summarizing the classrelationships.

FIGS. 5A-5C are a flow diagrams of the derivation process in the deriveengine.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The invention may be run on a variety of computers or collection ofcomputers under a number of different operating systems. The computercould be, for example, a personal computer, a mini computer, mainframecomputer or a computer running in a distributed network of othercomputers. Although the specific choice of computer is limited only bydisk and disk storage requirements, computers in the IBM PS/2 (TM)series of computers could be used in the present invention. Foradditional information on IBM's PS/2 series of computers, the reader isreferred to Technical Reference Manual Personal Systems/2 Model 50, 60Systems IBM Corporation, Part No. 68X2224 Order Number S68X-2224 andTechnical Reference 2 Manual Personal Systems/2 (Model 80) IBMCorporation Part No. 68X 2256 Order Number S68X-2254. One operatingsystem which an IBM PS/2 personal computer may run is IBM's OS/2 2.0(TM) for more information on the IBM OS/2 2.0 Operating System thereader is referred to OS/2 2.0 Technical Library, Programming Guide Vol.1, 2, 3 Version 2.00 Order Nos. 10G6261, 10G6495, 10G6494.

In the alternative, the computer system might be in the IBM RISCSystem/6000 (TM) line of computers which run on the AIX (TM) operatingsystem. The various models of the RISC System/6000 is described in manypublications of the IBM Corporation for example, RISC System/6000, 7073and 7016 POWERstation and POWERserver Hardware Technical reference,Order No. SA23-2644-00. The AIX operating system is described in GeneralConcepts and Procedure--AIX Version 3 for RISC System/6000 Order No.SC23-2202-00 as well as other publications of the IBM Corporation.

In FIG. 1, a computer 10, comprising a system unit 11, a keyboard 12, amouse 13 and a display 14 are depicted in block diagram form. The systemunit 11 includes a system bus or plurality of system buses 21 to whichvarious components are coupled and by which communication between thevarious components is accomplished. The microprocessor 22 is connectedto the system bus 21 and is supported by read only memory (ROM) 23 andrandom access memory (RAM) 24 also connected to system bus 21. Amicroprocessor in the IBM PS/2 series of computers is one of the Intelfamily of microprocessors including the 386 or 486 microprocessors.However, other microprocessors including, but not limited to, Motorola'sfamily of microprocessors such as the 68000, 68020 or the 68030microprocessors and various Reduced Instruction Set Computer (RISC)microprocessors such as the PowerPC chips manufactured by IBM, or othersby Hewlett Packard, Sun, Motorola and others may be used in the specificcomputer.

The ROM 23 contains among other code the Basic Input-Output system(BIOS) which controls basic hardware operations such as the interactionand the disk drives and the keyboard. The RAM 24 is the main memory intowhich the operating system and applications programs are loaded. Thememory management chip 25 is connected to the system bus 21 and controlsdirect memory access operations including, passing data between the RAM24 and hard disk drive 26 and floppy disk drive 27. The CD ROM 32 alsocoupled to the system bus 21 is used to store a large amount of data,e.g., a multimedia program or presentation.

Also connected to this system bus 21 are various I/O controllers: Thekeyboard controller 28, the mouse controller 29, the video controller30, and the audio controller 31. As might be expected, the keyboardcontroller 28 provides the hardware interface for the keyboard 12, themouse controller 29 provides the hardware interface for mouse 13, thevideo controller 30 is the hardware interface for the display 14, andthe audio controller 31 is the hardware interface for the speakers 15.An I/O controller 40 such as a Token Ring Adapter enables communicationover a network 46 to other similarly configured data processing systems.

One of the preferred implementations of the invention is as sets ofinstructions 50, 52, 54, 56, 58, 68 resident in the random access memory24 of one or more computer systems configured generally as describedabove. Until required by the computer system, the sets of instructionsmay be stored in another computer memory, for example, in the hard diskdrive 26, or in a removable memory such as an optical disk for eventualuse in the CD-ROM 32 or in a floppy disk for eventual use in the floppydisk drive 27. One skilled in the art would appreciate that the physicalstorage of the sets of instructions physically changes the medium uponwhich it is stored electrically, magnetically, or chemically so that themedium carries computer readable information. While it is convenient todescribed the invention in terms of instructions, symbols, characters,or the like, the reader should remember that all of these and similarterms should be associated with the appropriate physical elements.Further, the invention is sometimes described in terms that could beassociated with a human operator. No action by a human operator isdesirable in any of the operations described herein which form part ofthe present invention; the operations are machine operations processingelectrical signals to generate other electrical signals.

FIG. 2 shows the overall process for analyzing the object orientedprogram 50 with the parser 52 to generate the relation data library 54.The object oriented program 50 is typically source code in an objectoriented language such C++. The parser 52 is designed to understandclass definitions and method implementations for capturing immediateclass relationships. In the preferred embodiment, the invention isdesigned modularly so that the requisite modules can be selected andchanged as necessary without impacting other modules. For example, theparser 52 is designed for a specific object oriented programminglanguage. Depending on the object oriented program 50 to be analyzed, asuitable parser is chosen. Also, any changes in the object orientedlanguage conventions can be accommodated by changing the parser withoutaffecting any other module.

The parser 52 does not need to cover the amount of information which acompiler must address; it only needs to capture the dependencyrelationships in the source code. Thus, the parser is much faster andsimpler to implement than a compiler written for a comparable purpose. Aparser is typically considered as part of a compiler. In the case ofthis invention, the parser will be defined based on the targetprogramming language's specification, which determines the grammaticalrules, the reserved keywords, the lexical rules, and the syntax. Amongthe existing OO programming languages, the definition and usage oftemplates in C++ demonstrates a case of high complexity for the parser.However, the parser in this invention is still much simpler than acompiler, since the output generated by the parser will be used forfurther analysis of class relationships, instead of being used forgenerating machine-executable code. The parser's main responsibility isto parse the syntax and generate symbols and storing symbols in theformat that expresses the relationship among relevant symbols. Acompiler would use the information generated by parser, as well asinformation generated by other utilities in the compiler. Theseinformation include the creation, initial values, and destroy of thedata structures used in a program. The end goal of a compiler is togenerate machine executable code.

The parser needs: the target language's specification, an effective androbust way for handling the language's grammar, an effective symbollibrary that can store symbol data generated from parsing and can beused for retrieving data in parsing more relevant code. as well asgeneral requirements for any parser such as reserved keywords, standardlibrary functions included in the programming language, etc. Parsingalgorithms and parsers in general are well known to the art and part ofa standard computer science education. One skilled in the art couldeasily design a parser for a given object oriented language given thedescription provided herein.

The relationships retrieved by the parser and stored in the relationdata library are preferably described in a predicate form: predicatename (arg1, arg2, . . . ). Those skilled in the art would appreciatethat library should be construed as encompassing a database or othersuitable storage area for the class relationships. Examples of the typeof class relationships include inheritance usage and implementationusage relationships although these examples are not meant to beexclusive.

(a) inheritance relationship

inheritance (Class-A, Class-B, Inheritance-Type). which means thatClass-A inherits from Class-B with Inheritance-Type.

For example, inheritance (Scroll Bar, Window, Public). describes thatclass Scroll Bar inherits from class Window with type Public. In C++,this means that every Public-access member of class Window is now aPublic-access member of class Scroll Bar and every Protect-access memberof class Window is now a Private-access member of class Scroll Bar.

(b) Usage relationship

use (Class-A, Class-B, Use-Type, Use-In-Method, #-of -occurrences). Forexample, use (Window, DeviceContet, return-value, GetDevContext, 1).

describes that Class Window uses an object of Class DeviceContext as thereturn of GetDevContext method. Typically, there are 4 types of usagerelationships that should be captured by the parser:

(i) return-value

(ii) return-reference

(iii) use-value

(iv) use-reference

Usage relationships are based on the signature of member functions of aclass.

In the case of a return--value usage relationship, the method returns aninstance of a class for example,

use (Window, DeviceContext, return-value, GetDevContext, 1)

indicates that Class Window has a method GetDevContext and this methodreturns an instance of class DeviceContext. Therefore, in the executionof GetDevContext method, the computer system needs to construct anobject of class Devicecontext. That is, the computer system needs toknow the detailed definition of class DeviceContext to instantiate anobject in the machine's memory and load in the code that contains thedetailed definition.

In the case of a return-reference usage relationship, the method returnsthe machine address of an object of a class. For example,

use (Window, PlatWindow, return-reference, GetParent, 1)

indicates that Class Window has a method GetParent which returns apointer (address) to an object of Class PlatWindow. In this case, aslong as there is a valid address of an object of class PlatWindow, thecomputer system does not need to load in the definition of classPlatWindow.

In the case of a use--value usage relationship, the method uses aninstance of a class as one of its arguments. For example,

use (Window, CurveLine, use-value, DrawCarve, 1)

indicates that class window has a DrawCarve method that needs aninstance of Class CurveLine. The computer system needs to have an objectof CurveLine in its memory for executing the DrawCurve method.

In the case of a use-reference relationship, the method has a referenceof an object of a class in its arguments. For example,

use (Window, DeviceContext, use-reference, Draw, 1)

indicates that the Draw method of class Window needs to have a referenceto an instance of the class Device Context. In executing the Draw methodof class Window, the computer system needs a valid address of an objectof Class Device Context. Whether the system needs to load in the code ofClass Device Context will depend on the detailed implementation andother passed-in arguments of the Draw method.

(c) Implementation Usage Relationship

imp (Class-A, Class-B, Use-Type, Use-In-Method, #-of-occurrences)Implementation Usage captures the usage relationships that occurred onlyin the implementation body of the object rather than in the method'sinterface for example, in C++ syntax, class window has a methodGetBackColor as:

    ______________________________________                                        Color Window::GetBackColor( )                                                                       where PS is used                                        { hps PS = gETps( );                                                                             in the implementation,                                     { return QueryBackColor (ps);                                                                       but not used in                                                               the signature.                                          ______________________________________                                    

An implementation body of a method can be distinguished from thesignature of a method. The implementation body describes the details ofthe implementation of the method, whereas the "signature" describes theinterface of the method. In other words, the signature describes theinput and output of a method, while the implementation body defines theexact logic and conditions of the execution of a method. Parsers withinthe object oriented compilers do not parse the implementation body asthis information is unimportant at this step of the overall process ofcompilation.

Since imp() and use() both cover usage relationships, a reasonablepractice is:

(i) use() describes the usage relationships that described in the classdeclaration of an object.

(ii) imp() catches the usage relationships that are not included inuse() but exist in the method's implementation body.

For a huge object oriented system, the immediate relationships capturedby the parser and stored in the relation data library will beoverwhelmingly large already. It will likely require a large amount ofmemory to load them all simultaneously. Therefore, a "divide-andconquer" approach is adopted in the preferred embodiment. The firstportion of the derive engine, the facts builder 56, preprocesses theimmediate relationships stored in the relation data library 54 andstores them in a facts data library 58 by class and/or type ofrelationship as shown in FIG. 3. As the relation data library can beconsidered as raw data generated by the parser, the Facts Data Librarycan be viewed as information organized in a specific way suitable forfurther use. Since most dependency relationships are about classes, theFacts Data Library generated from the relation data library ispreferably organized in a class-oriented fashion. The preprocessingsteps required to generate the Facts Data library include: (1)generating a collection list of classes (2) enhancing the list ofclasses by adding the maximal level of inheritance of each class in theinheritance tree. As multiple inheritance is allowed in most OOprogramming languages, this increases the complexity of the inheritancetree of and OO system. A class may inherit from multiple parents, andthere can exist more than one path from a "root" base class to theparticular class. The length of a path in this inheritance treeindicates the level of inheritance of the particular class the length ofthe largest path of a particular class will be chosen to represent themaximal level of inheritance of that class. Then, as discussed below,the derive engine traverses the facts data library to derive multiplelevel class relationships.

In one preferred embodiment, the Facts Data Library includes inheritancerelationship data, depend level relationship data and dependance levelrelationship data.

(1) Inheritance relationship data is described above in connection withthe data library, e.g., inheritance(Class-A, Class-B, Inheritance-Type).

(2) Depend-level relationship data (class-oriented) depend (Class-A,Level, List-A). which describes that List-A is a list structure thatcontains information of class Class-A's dependency at the level ofLevel.

For example, based on the following data in the relation data library:

inheritance (ClassA, ClassX, public).

use(classA, classC, return-ref, getC,1).

use (classA, classB, use-value setC, 1).

use(classA, classD, use-ref, setC, 1).

use(classC, classB, use-value, constructor,1).

use(classC, classD, use-ref, constructor, 1).

imp(classC, classE, use-ref, constructor, 1).

use(classD, classF, use-value, constructor,1).

use(classE, classG, use-ref, constructor,1).

(not a complete description of the Relationship Data Library)

The facts builder will generate:

depend (A, 1, L1).

depend (A, 2, L2).

depend (A, 3, L3).

where L1 can be described as a list including the following: ##STR1##and L2 can be described as including the following: ##STR2##

The Facts Data Library should include information to cover at least onelevel "depend-level relationship data" for every class in the examinedobject oriented program. That is, for each class X, there is a depend(X, 1, List-X) in the Facts Data Library.

The Facts builder can generate and store more than 1 level dependinformation for each class into the Facts Data Library with the systemcapacity and other factors considered.

(3) dependee-level relationship data

impact (Class-A, Level, List-A).

List-A describes the list of <ClassName, Type> pairs that classClassNamehas a type dependency relationship indicating that Class ClassNamedepends on Class-A and this is a level dependency.

Note that impact () describes the opposite direction of dependency asdescribed by depend ().

FIG. 4 shows the process initiated by a user query for a classrelationship according to the invention. A user at a workstation 60 asksfor a class relationship between two objects in an object orientedsystem in a query 62 for the class and level of the relationship. Otherinformation can also be requested such as a complete list of classeswhich have to be instantiate to be used by a given class. Although thefigure shows the process as though it takes place on a singleworkstation, one skilled in the art would appreciate that the maincomponents of the invention, the parser, the derive engine and thevarious libraries may be located at a more powerful server machinebecause of their size and the query function can be provided by arelatively small client at the user's workstation. One example of aquery statement in command-line syntax:

    ______________________________________                                        FindXXX  All    Depend     (Class name)                                                                           <Option>                                  ______________________________________                                               Arg1 Arg2       Arg3       Arg4                                        ______________________________________                                    

Where FindXXX is the Query Process Command Name. Find Dep means find thelist of dependent FindImp means find the list of impacts.

Arg1 is the scope of search. ALL indicates that the search to haveindicates that the search will continue for n number maximal scope; n oflevels. Arg2 is the type of dependency: e.g., inheritance (inh)return-value (rtv), return reference (rft), use-value(usv),use-reference(usf), etc. as discussed above. Arg4 is an option tospecify how the information is presented; e.g., no option specified:display on screen; -s <filename> saved in file; -p print.

The query 62 is passed to a tool 64 which forwards the query 66 to thederive engine 68 in the proper format. In the preferred embodiment, thequeries 62 and 63 used the query format described above. Alternatively,Query 62 could be in a format specific to a user interface to the tool.The derive engine 68 traverses 70 the facts data library 58 to derivethe multiple level class relationships. This process is described ingreater detail below. A list 72 of the desired class relationships isreturned to the derive engine 72 from the facts library. The list 72 canbe described, in the following format;

(List-1, List-2, List-3, . . . ) where

List-n: the list of level-n dependency, and can be described as:

{{className, <Occurance>, <Type>}. . . }

where ClassName must exist,

<#Occurrence> and <Type> are optional, depending on the type of query issubmitted. Those skilled in the art would readily appreciate thatalternative formats could be used.

The tool receives the final output 74 and formats the output 76 in apleasing and readable report 78. The final output can be in variousformats. One example is an ascii format with indention. This format issuitable for displaying on screen, printing, and saving in a file. Forexample, the class relationships may be displayed as shown below.

    ______________________________________                                          B      UseBy Value                                                             C     RtnByReF                                                                D     UseByRef                                                               E      Inheritance                                                             W        ImpByRef                                                             X       UseByRef                                                             F       UseBy Value                                                            G        RtnByRef                                                              H        UseByValue                                                           I        UseByRef                                                             J        Inheritance                                                           K        RtnByRef                                                        ______________________________________                                    

A tree-like format is shown in FIG. 4B. This tree format is suitable fordisplaying on screen. It may require additional processing for printingor saving in file(s). Suitable icons are selected to represent eachclass. The lines 83, 83', 83" which connect the class icons may beselected to represent the class relationship, i.e., presented indifferent ways, e.g., highlighted, colored or otherwise emphasized torepresent the different types of dependencies between classes. Oneskilled in the art would recognize that the icons would embracegraphics, symbols as well as alphanumeric characters.

By separating the toll 64 from the derive engine 68, the user interfaceis separated from the derive function. Thus, different "front ends" maybe developed to present the class relationship information in differentways without necessitating redesign of the derive engine itself.Further, the derive engine itself may be enhanced in various ways. Thederive engine may be enhanced to cover new kinds of queries. The deriveengine may be enhanced to use new technologies developed for moreefficient use of computer resources. The derive engine may also beenhanced to be suitable for a new GUI style developed for specifyingqueries and/or displaying query results.

The derivation process in the derive engine is depicted in FIGS. 5A-5C.The process is invoked in step 100 when the tool sends a query to thederive engine asking for level n dependency information of class A instep 101.

The query in step 101 also specifies that the output format isascii-indented. In step 103, the initial values for the formatparameters are set. Line number is set to 1, Level is set to 0 andIndentation is set 0. In step 105, the process for assembling the outputis called. This process is shown in greater detail in FIG. 5B. In step107, the process ends.

As shown FIG. 5B, the process for assembling the output in the deriveengine starts with the call specifying the class, line, indentation andlevel as variables in step 109. Entries are added into the Processed₋₋Table in step 111 which contain information about the className, linenumber and amount of indentation. The information in this table will, ofcourse, vary according to the nature of the query and the type of outputformat specified. In step 113, a test is performed to determine whetherthere is more than one entry in the Processed₋₋ Table for class A. Ifso, it means that the class has already been processed in the sessionand that there is no need to repeat the following steps. The processreturns step 115. If there is no entry, in step 117, Line is set toLine+1, LevelNext is set to Level+1 and IndentationNext is set toIndentation+1. Next, in step 119, a test is performed to determinewhether the level is less than or equal to n. If not, that is, the levelis greater than n, the process has reached the required level in theclass hierarchy and the process may stop. The process returns in step121. If there are more levels to output, in step 123, the depend levelrelationship data is retrieved from the facts data library for (A, 1, L)where (A, 1, L) is the argument list for depend (A, 1, L) andA=classname, 1=level number and L=List of dependency data. Next, in step125, a test is performed to determine whether L=0 which means that theclass does not have a dependency list. If L=0, in step 127, the processreturns. If L is not equal to zero, then the class has a dependency listand the ListProc procedure is called in step 129. The ListProc procedureis shown in greater detail in FIG. 5C. The process in step 131 after thecompletion of the ListProc procedure.

As shown in FIG. 5C, the ListProc procedure, called in step 137, is afunction of the dependency list, line, next indentation and next level.In step 139, the first element in the list is chosen as one of the inputarguments of process functions, which is in step 141. In step 141, theassembly process shown in FIG. 5B is called, for the first element inthe list. After the process is complete, a test is performed in step 143to determine whether T=0. T is a list. If T is an empty list, then T=0is true. If so, the process returns, step 145. If not, the ListProcprocess iterates for T. The process returns step 149.

The invention represents an important advance in the state of the art.Most existing tools can hardly function in a huge object oriented systemthat has thousands of relationships due to the huge overhead associatedwith the problem. In the prior art, to generate multiple classrelationships, a tool will usually require disk space and memory to growwith scale of the immediate relationships exponentially. The inventiondoes not require such exponential growth. As the appropriate parser canbe selected for the source code in which the object oriented program iswritten, the design is compiler independent. Indeed, the invention doesnot call for compilation as such at all.

A parser as described above can be portable across various platforms.The parser generates much less information compared with data from atypical compiler to the same object oriented programming language.However, the amount of information is still huge. It is too big tohandle. The divide-and-conquer approach is effective in organizing theraw data into more usable and manageable information library forgenerating dependency reports. The separation of parser, tool, andderive engine is robust and flexible to meet the continuously growingenvironment in large-scale object-oriented software development.

The invention does not rely on compilers. In one embodiment, the systemmay include a collection of interchangable parsers from which the usemay select the appropriate parser given the language of the objectoriented program to be examined. When porting an existing objectoriented product to another platform, it is important to understand thesource code. However, most existing software analysis tools will requirethe source code to be compiled on the target platform. Presently, mostobject oriented programming languages are still lacking of compilercompatibility. This hinders the learning process of porting an existingobject oriented software to another platform. A typical parser whenincorporated in the compiler does not provide dependency relationship tohelp understand the structure of the code. The range and depth ofinformation provided by the invention allows the developer to know theperquisites of porting any specific class object in a software product.

While the invention has been shown and described with reference toparticular embodiments thereof, it will be understood by those skilledin the art that the invention can be practiced, with modification, inother environments. For example, although the invention described abovecan be conveniently implemented in a general purpose computerselectively reconfigured or activated by software, those skilled in theart would recognize that the invention could be carried out in hardware,in firmware or in any combination of software, firmware or hardwareincluding a special purpose apparatus specifically designed to performthe described invention. Therefore, changes in form and detail may bemade therein without departing from the spirit and scope of theinvention as set forth in the accompanying claims.

I claim:
 1. A method for identifying class relationships in an objectoriented system and for presenting class relationships to a user,comprising the steps of:parsing an object oriented program in an objectoriented source code language for immediate class relationship data;storing the immediate class relationship data in a relation datalibrary; in response to a user query, deriving multiple level classrelationship data from the immediate class relationship data; andpresenting the multiple level class relationship data on a systemdisplay.
 2. The method as recited in claim 1 wherein the deriving stepfurther comprises:processing the immediate relationship data for eachclass of object; storing the processed immediate relationship data in afacts library according to class and type of relationship; andtraversing the facts library in response to the user query to derive themultiple level class relationship data.
 3. The method as recited inclaim 1 wherein the user query specifies a desired format of themultiple class relationship data and the method further comprises thestep of presenting the multiple class relationship data according to thedesired format.
 4. The method as recited in claim 3 wherein the desiredformat is a tree structure and classes are presented as icons and classrelationships are presented as lines connecting the icons, each lineconnecting classes presented in a manner to indicate a particular classrelationship between the classes.
 5. A system including processor,memory and display for identifying class relationships in an objectoriented system and for presenting class relationships to a usercomprising:a parser for parsing an object oriented program for immediateclass relationship data; a first library for storing the immediate classrelationship data; a facts builder for organizing the immediate classrelationship data according to class; a second library for storing theorganized immediate class relationship data; a derive engine forderiving multiple level class relationships from the organized immediateclass relationship data; and a query tool responsive to user input fortransmitting a user query to the derive engine and presenting themultiple level class relationships on the display.
 6. The system asrecited in claim 5 further comprising:a user workstation includingmemory, processor and display on which the query tool resides; a serverincluding memory and processor on which the parser, facts builder,derive engine and libraries reside; and a network coupled to the userworkstation and server, wherein the query tool transmits the user queryover the network to the server and the results of the query includingthe multiple level class relationships are transmitted from the serverover the network to the user workstation.
 7. The system as recited inclaim 6 wherein the query specifies a number of levels of classrelationships for the derive engine to derive the multiple level classrelationships.
 8. The system as recited in claim 6 wherein the immediateclass relationships are stored in the first library in predicate form.9. The system as recited in claim 6 wherein the organized immediateclass relationships are also stored according to class relationship inthe second library.
 10. The system as recited in claim 6 wherein theparser can identify inheritance, usage and implementation usage classrelationships in the object oriented program.
 11. The system as recitedin claim 6 wherein the second library contains inheritance, depend leveland dependence level relationship data.
 12. A program storage device forstoring sets of instructions for identifying class relationships in anobject oriented system and for presenting class relationships to a user,comprising:means for parsing an object oriented program for immediateclass relationship data; means for organizing the immediate classrelationship data according to class; means responsive to a user queryfor deriving multiple level class relationship data from the organizedimmediate class relationship data; means for presenting multiple levelclass relationship data on a computer system display; and the means onthe device activated when the device is coupled to and accessed by acomputer system.
 13. The device as recited in claim 12 wherein thederiving means further comprises:means for processing the immediaterelationship data for each class of object; means for storing theprocessed immediate relationship data in a facts library according toclass and type of relationship; and means for traversing the factslibrary in response to the user query to derive the multiple level classrelationship data.
 14. The device as recited in claim 12 wherein theuser query specifies a desired format of the multiple class relationshipdata and the device further comprises means for presenting the multipleclass relationship data according to the desired format.
 15. The deviceas recited in claim 12 wherein the desired format is a tree structureand classes are presented as icons and class relationships are presentedas lines connecting the icons, each line connecting classes presented ina manner to indicate a particular class relationship between theclasses.
 16. The device as recited in claim 12 wherein the user queryspecifies a number of levels of class relationships for the derivingmeans to derive the multiple level class relationship data.
 17. Thedevice as recited in claim 12 wherein the immediate class relationshipsare stored in a first library in predicate form.
 18. The device asrecited in claim 12 wherein the parsing means can identify inheritance,usage and implementation usage class relationships in the objectoriented program.